#include<iostream>

int main()
{
    using namespace std;
    int num = 0,sum = 0;
    cin >> num;
    while ( num != 0)
    {
        sum += num;
        cout << sum << endl;
        cin >> num;
    }

    return 0;
}